import { reactive } from "vue"
export default function checkShow() {
  const checkOperateButtonShow = (show: string) => {
    switch (show) {
      case "待审核":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "通过",
            type: "success",
            function: () => {
              operatePass()
            }
          },
          {
            title: "驳回",
            type: "danger",
            function: () => {
              operateReject()
            }
          },
        ];
      case "报名中":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "大赛设置",
            type: "success",
            function: () => {
              operateCompetitionSetting()
            }
          },
          {
            title: "暂停",
            type: "danger",
            function: () => {
              operatePause()
            }
          },
        ];
      case "进行中":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "大赛设置",
            type: "success",
            function: () => {
              operateCompetitionSetting()
            }
          },
          {
            title: "暂停",
            type: "danger",
            function: () => {
              operatePause()
            }
          },
        ];
      case "评审中":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "分配评审",
            type: "success",
            function: () => {
              operateAllocationReview()
            }
          },
          {
            title: "暂停",
            type: "danger",
            function: () => {
              operatePause()
            }
          },
        ];
      case "公示中":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "填写公示公告",
            type: "primaryButton",
            function: () => {
              operateFillPublicAnnouncement()
            }
          },
          {
            title: "填写大赛风采",
            type: "primaryButton",
            function: () => {
              operateFillCompetitionStyle()
            }
          },
        ];
      case "奖品发放中":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "填写发放进度",
            type: "primaryButton",
            function: () => {
              operateFillDistributionProgress()
            }
          },
          {
            title: "填写大赛风采",
            type: "primaryButton",
            function: () => {
              operateFillCompetitionStyle()
            }
          },
        ];
      case "已结束":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "获奖作品",
            type: "primaryButton",
            function: () => {
              operateAwardWorks()
            }
          },
          {
            title: "查看大赛风采",
            type: "primaryButton",
            function: () => {
              operateSeeCompetitionStyle()
            }
          },
        ];
      case "已暂停":
        return [
          {
            title: "查看",
            type: "primaryButton",
            function: () => {
              operateShow()
            }
          },
          {
            title: "取消暂停",
            type: "success",
            function: () => {
              operateCancelPause()
            }
          },
          {
            title: "暂停原因",
            type: "danger",
            function: () => {
              operatePauseReason()
            }
          },
        ];
      case "已驳回":
        return [
          {
            title: "修改",
            type: "danger",
            function: () => {
              operateModify()
            }
          },
          {
            title: "申请开通",
            type: "success",
            function: () => {
              operateApplyForActivation()
            }
          },
          {
            title: "暂停原因",
            type: "danger",
            function: () => {
              operatePauseReason()
            }
          },
        ];
    }
  }
  /**
 * 操作弹窗布尔值
 */
  let operateDialogVisibleList = reactive(
    {
      rejectOperateVisible: false,
      pauseOperateVisible:false,
    }
  )
  /**
   * 点击查看操作
   */
  const operateShow = () => {
    console.log("点击查看操作");
  }
  /**
   * 点击通过操作
   */
  const operatePass = () => {
    console.log("点击通过操作");
  }
  /**
   * 点击驳回操作
   */
  const operateReject = () => {
    console.log("点击驳回操作");
    operateDialogVisibleList.rejectOperateVisible = true;
  }
  /**
   * 点击大赛设置操作
   */
  const operateCompetitionSetting = () => {
    console.log("点击大赛设置操作");
  }
  /**
   * 点击暂停操作
   */
  const operatePause = () => {
    console.log("点击暂停操作");
    operateDialogVisibleList.pauseOperateVisible = true;
  }
  /**
   * 点击分配评审操作
   */
  const operateAllocationReview = () => {
    console.log("点击分配评审操作");
  }
  /**
   * 点击填写公示公告操作
   */
  const operateFillPublicAnnouncement = () => {
    console.log("点击填写公示公告操作");
  }
  /**
   * 点击填写大赛风采操作
   */
  const operateFillCompetitionStyle = () => {
    console.log("点击填写大赛风采操作");
  }
  /**
   * 点击填写发放进度操作
   */
  const operateFillDistributionProgress = () => {
    console.log("点击填写发放进度操作");
  }
  /**
   * 点击获奖作品操作
   */
  const operateAwardWorks = () => {
    console.log("点击获奖作品操作");
  }
  /**
  * 点击查看大赛风采操作
  */
  const operateSeeCompetitionStyle = () => {
    console.log("点击查看大赛风采操作");
  }
  /**
  * 点击取消暂停操作
  */
  const operateCancelPause = () => {
    console.log("点击取消暂停操作");
  }
  /**
  * 点击暂停原因操作
  */
  const operatePauseReason = () => {
    console.log("点击暂停原因操作");
  }
  /**
  * 点击修改操作
  */
  const operateModify = () => {
    console.log("点击修改操作");
  }
  /**
  * 点击申请开通操作
  */
  const operateApplyForActivation = () => {
    console.log("点击申请开通操作");
  }
  return {
    checkOperateButtonShow,
    operateDialogVisibleList
  }
}